Trò chơi đua xe động vật trong UNITY Engine
114.642 lượt xem;
- InterpolationElasticOut.cs
- Interpolations /
- Bapk /
- Scripts /
- Assets /
- project /
1 using UnityEngine;
2 using System.Collections;
3
4 public class InterpolationElasticOut : InterpolationElastic {
5 public InterpolationElasticOut(float value, float power) : base(value, power) {}
6
7 public override float apply(float a)
8 {
9 a = 1 - a;
10 return (1 - Mathf.Pow(value, power * (a - 1)) * Mathf.Sin(a * 20) * 1.0955f);
11 }
12 }
2 using System.Collections;
3
4 public class InterpolationElasticOut : InterpolationElastic {
5 public InterpolationElasticOut(float value, float power) : base(value, power) {}
6
7 public override float apply(float a)
8 {
9 a = 1 - a;
10 return (1 - Mathf.Pow(value, power * (a - 1)) * Mathf.Sin(a * 20) * 1.0955f);
11 }
12 }